
import 'package:date_format/date_format.dart';
import 'package:flutter/foundation.dart';
import 'package:s_mankey/config/resource_mananger.dart';
import 'package:s_mankey/config/storage_manager.dart';
import 'package:s_mankey/model/user_model.dart';


class LoginVModel extends ChangeNotifier {

  UserModel userModel;
  bool get isLogin => userModel != null;

  //
  int(){

  }

  /// 用户登录数据
  saveUser(UserModel user){
    userModel = user;
    notifyListeners();
    StorageManager.localeStorage.setItem(AppGlobalConfig.USERINFO, user); //保存数据
  }

  /// 清除持久化的用户数据
  clearUser() {
    userModel = null;
    notifyListeners();
    StorageManager.localeStorage.setItem(AppGlobalConfig.USERINFO, null); //保存数据
  }
}